package com.oweight.sagacious.auth.client.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;

import javax.servlet.http.HttpServletRequest;

/**
 * 用户认证配置
 *
 * @author SAGE
 * @version v1 2019/10/16 13:43
 */
@Data
public class UserAuthConfig {

    /**
     * 通过token-header去拿前端带过来的token
     */
    @Value("${auth.user.token-header}")
    private String tokenHeader;

    private byte[] pubKeyByte;

    public String getToken(HttpServletRequest request) {
        return request.getHeader(this.getTokenHeader());
    }

}
